<!-- 弹窗编辑  夫妻双方房产信息-->
<!--  夫妻双方房产信息 begin -->
<div class="action-dialog-model-fixed-body">
<div class="detailsBox">
<div class="openBox">
	<h3>
		<i class="jtIco"></i> 夫妻双方房产信息
	</h3>
	<div class="detaiTab">
		<form action="<@url value='/house/house_save'/>" method="post" class="action-ajax-form">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tbody>
					<tr>
						<td align="right" class="bg" width="20%"><span style="color: red;">*</span>房产地址：</td>
						<td width="30%">
							<div>
							<select id="select_provinceId_1" name="province" value="${vo.province}" onchange="provinceOnchange(1)"></select>&nbsp;&nbsp; 
	                		<select id="select_areaId_1"  name="city" value="${vo.city}" onchange="areaOnchange(1)"></select>&nbsp;&nbsp; 
	                		<select id="select_cityId_1" name="county" value="${vo.county}" ></select>
	                		</div><br/>
	                		<input type="text" name="address" id="address" class="action-valid-field" data-action-valid-rule="required;"
                                   data-action-valid-msg-required="房产地址不能为空" value="${vo.address}"/>
                            <span class="action-field-error" for="address" style="color:red;"></span>
						</td>
						<td align="right" class="bg" width="20%"><span style="color: red;">*</span>房产性质：</td>
						<td width="30%">
							<@select dataSouceType="CQXZ" value="${vo.aypes}" id="aypes"  name="aypes" class="tabInp action-valid-field"
							data\-action\-valid\-rule="required;"
							data\-action\-valid\-msg\-required="房产性质不能为空！" />
							<span class="action-field-error" for="aypes" style="color: red;"></span> 
						</td>
					</tr>
					<tr>
						<td align="right" class="bg" width="20%"><span style="color: red;">*</span>是否按揭：</td>
						<td width="30%">
							<@select dataSouceType="SFAJ" value="${vo.isMortgage}" id="isMortgage"  name="isMortgage"  class="tabInp action-valid-field"
							data\-action\-valid\-rule="required;"
							data\-action\-valid\-msg\-required="是否按揭不能为空！" />
							<span class="action-field-error" for="isMortgage" style="color: red;"></span> 
						</td>
						<td align="right" class="bg" width="20%"><span style="color: red;">*</span>估值方法：</td>
						<td width="30%">
							<@select dataSouceType="GZFF" value="${vo.valuation}" id="valuation"  name="valuation"  class="tabInp action-valid-field"
								data\-action\-valid\-rule="required;"
								data\-action\-valid\-msg\-required="估值方法不能为空！" />
								<span class="action-field-error" for="valuation" style="color: red;"></span> 
						</td>
					</tr>
					<tr>
						<td align="right" class="bg" width="20%"><span style="color: red;">*</span>信贷经理估值（万元）：</td>
						<td width="30%">
							
                            
                             <input type="text"  id="housePrice"  size="30" name="housePrice" value="${vo.housePrice}" class="action-valid-field" data-action-valid-rule="required;maxlength:12;reg:^\d+(.\d{1,2})?$;" data-action-valid-msg-required="信贷经理估值不能为空！"  autocomplete="off" />
                            <span class="action-field-error" for="housePrice" style="color:red;"></span>
						</td>
						<td align="right" class="bg" width="20%"></td>
						<td></td>
					</tr>
					<tr>
						<td colspan="4" align="center">
						    <input type="hidden" name="loanapplyId" id="loanapplyId" value="${loanapplyId}" />
						    <input type="hidden" name="houseId" id="houseId" value="${vo.id}" />
							<input type="submit" value="保存" class="btn_auto_30 btn_blue" /><span class="red fs14 ml10"></span>
						</td>
					</tr>
					 
				</tbody>
			</table>   
		</form>  
	</div> 
	</div>
</div>
</div>
 <@js>
provinceLoad(1);
	provinceLoad(2);
	function provinceLoad(index){
		var provinceCode = $("#select_provinceId"+"_"+index).attr('value');
		$.ajax({
			type: "GET",
			url:"${crmUrl}/common/findProvinces",
			dataType:"jsonp",
			jsonp:"_callback",
			success:function(result){
					$("#select_provinceId"+"_"+index).empty();
					 $("#select_provinceId"+"_"+index).append("<option value=''>请选择</option>"); 
					 $("#select_areaId"+"_"+index).empty();
					 $("#select_areaId"+"_"+index).append("<option value=''>请选择</option>"); 
					 $("#select_cityId"+"_"+index).empty();
					 $("#select_cityId"+"_"+index).append("<option value=''>请选择</option>");   
					 $.each(result.data,function(key,value){
					 	if(provinceCode == value[0])
						    $("#select_provinceId"+"_"+index).append("<option value='"+value[0]+"' selected='selected'>"+value[1]+"</option>");   
						else
							$("#select_provinceId"+"_"+index).append("<option value='"+value[0]+"'>"+value[1]+"</option>");     
					 });
					 provinceOnchange(index,function(){
					 	 areaOnchange(index);
					 });
				    
		 		}
	 	});
     };
	
	
	function provinceOnchange(index,callback){
		var provinceCode = $("#select_provinceId"+"_"+index).val() || $("#select_provinceId"+"_"+index).attr('value');
		var areaCode = $("#select_areaId"+"_"+index).val() || $("#select_areaId"+"_"+index).attr('value');
		if(!provinceCode){
			 $("#select_areaId"+"_"+index).empty();
			 $("#select_areaId"+"_"+index).append("<option value=''>请选择</option>"); 
			 $("#select_cityId"+"_"+index).empty();
			 $("#select_cityId"+"_"+index).append("<option value=''>请选择</option>");   			
			 return true;
		}
		$.ajax({
			type: "GET",
			url:"${crmUrl}/common/findCityByProvinceCode",
			data:{provinceCode:provinceCode},
			dataType:"jsonp",
			jsonp:"_callback",
			success:function(result){
					 $("#select_areaId"+"_"+index).empty();
					 $("#select_areaId"+"_"+index).append("<option value=''>请选择</option>"); 
					 $("#select_cityId"+"_"+index).empty();
					 $("#select_cityId"+"_"+index).append("<option value=''>请选择</option>");   
					 $.each(result.data,function(key,value){
					 	if(areaCode == value[0])
						    $("#select_areaId"+"_"+index).append("<option value='"+value[0]+"' selected='selected'>"+value[1]+"</option>");   
						else
					 		$("#select_areaId"+"_"+index).append("<option value='"+value[0]+"'>"+value[1]+"</option>");   
						 
					 });
					 callback &&　callback();
		 		}
	 	});
     }
	      
	 function areaOnchange(index){
		var areaCode = $("#select_areaId"+"_"+index).val() || $("#select_areaId"+"_"+index).attr('value');
		var cityCode = $("#select_cityId"+"_"+index).val() || $("#select_cityId"+"_"+index).attr('value');
		if(!areaCode){
			$("#select_cityId"+"_"+index).empty();
		    $("#select_cityId"+"_"+index).append("<option value=''>请选择</option>");   
			return true;
		}
		$.ajax({
			type: "GET",
			url:"${crmUrl}/common/findDistrictByCityCode",
			data:{cityCode:areaCode},
			dataType:"jsonp",
			jsonp:"_callback",
			success:function(result){
				 $("#select_cityId"+"_"+index).empty();
				 $("#select_cityId"+"_"+index).append("<option value=''>请选择</option>");   
				 $.each(result.data,function(key,value){
				 	if(cityCode == value[0])
					    $("#select_cityId"+"_"+index).append("<option value='"+value[0]+"' selected='selected'>"+value[1]+"</option>");   
					else
						$("#select_cityId"+"_"+index).append("<option value='"+value[0]+"'>"+value[1]+"</option>");   
				 });
			 }
	 	});
	}
	</@js>
<@jsRender/>
<!--夫妻双方房产信息end -->